package cn.sofwin.day0107;

import java.util.Scanner;

public class Test02 {
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        text();

    }

    /**
     * 显示一级菜单
     */
    static void text() {
        System.out.println("1.登录系统");
        System.out.println("2.退出");
        int choose1;
        choose1 = sc.nextInt();

        switch (choose1) {
            case 1:
                text1();
                break;
            case 2:
                break;
            default:
                System.out.println("输入错误");
                text();

        }

    }

    /**
     * 显示二级菜单
     */
    static void text1() {

        System.out.println("1.客户信息管理");
        System.out.println("2.购物结算");
        System.out.println("3.真情回馈");
        System.out.println("4.注销");
        System.out.println("0.返回上一级");
        int choose2 = sc.nextInt();
        switch (choose2) {
            case 1:
                text2();
                break;
            case 3:
                text3();
                break;
            case 0:
                text();
                break;
            default:
                System.out.println("输入错误");
                text1();

        }
    }

    /**
     * 显示三级菜单
     */
    static void text2() {
        System.out.println("购物管理系统>客户信息管理");
        System.out.println("1.显示所有客户信息");
        System.out.println("2.添加客户信息");
        System.out.println("3.修改客户信息");
        System.out.println("4.查询客户信息");
        System.out.println("0.返回上一级菜单");
        int choose3 = sc.nextInt();
        switch (choose3) {
            case 0:
                text1();
                break;
        }
    }

    /**
     * 显示四级菜单
     */
    static void text3() {
        System.out.println("购物管理系统》真情反馈");
        System.out.println("1.幸运大放送");
        System.out.println("2.幸运抽奖");
        System.out.println("0.返回上一级菜单");

        int choose4 = sc.nextInt();
        switch (choose4) {
            case 0:
                text1();
                break;
        }
    }

}
